package com.itheima.edu.info.manager.day14;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerTest extends Thread{
 volatile static AtomicInteger  a=new AtomicInteger();

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            synchronized (this){
                System.out.println(a.incrementAndGet()+"个");
            }

        }

    }
}
